1. Field of the Invention
The present application relates to a coding device, a coding method, and a storage medium that can code sound data played by an electronic musical instrument, and to a decoding device, a decoding method, and a storage medium that can decode coded data of sound played by an electronic musical instrument.
2. Related Art
Conventionally, an electronic musical instrument stores, in memory in advance, waveform data for which a sound that is actually performed is recorded in PCM (Pulse Code Modulation) format (hereinafter, referred to as “PCM waveform data”), and when an operation of musical performance is made, it generates a sound by employing the PCM waveform data as a sound source.
Since such an electronic musical instrument may generate a sound in a plurality of channels simultaneously, semiconductor memory that can be accessed at a high speed is equipped as memory for PCM waveform data. Since such semiconductor memory increases in cost with its capacity increasing, it is necessary to save cost by decreasing its capacity. Therefore, PCM waveform data is not stored in semiconductor memory as it is, but rather is stored in semiconductor memory in a state in which the data is coded and its data volume is compressed.
Furthermore, such an electronic musical instrument generating a sound in a plurality of channels simultaneously leads to increase in processing load on hardware. Therefore, in regard to a coding method, although it is necessary to decrease processing load on hardware, a format in which sound quality deterioration occurs is not appropriate. That is to say, in regard to a coding method, a method that can achieve both a reduction in processing load on hardware as well as a decrease in sound quality deterioration has been demanded.
Furthermore, in addition to the curbing the memory capacity as stated above, another purpose of coding is to increase the number of channels generating a sound simultaneously in an electronic musical instrument. Memory has a maximum transfer data rate and this maximum transfer data rate determines the number of channels generating sound simultaneously. Therefore, for coding of PCM waveform data, if it is possible to decrease the data transfer amount per channel, it becomes possible to generate sound simultaneously in more channels.
In this regard, Japanese Unexamined Patent Application, Publication No. H07-160267 discloses a waveform data coding device that expresses an amplitude value of a waveform or a differential value thereof with floating point data consisting of a fixed-point part and an exponent part, standardizes exponent parts corresponding to a predetermined number of consecutive fixed-point parts by a value of one exponent part, and embeds a compressed exponent part thus obtained or a differential compressed exponent part, which is a differential value thereof, as a portion of bit data of the fixed-point part and then outputs as coded data.
Furthermore, Japanese Unexamined Patent Application, Publication No. H07-199996 discloses a waveform data coding device that expresses an amplitude value of a waveform or a difference value thereof with floating point data consisting of a fixed-point part and an exponent part, standardizes exponent parts corresponding to a predetermined number of the consecutive fixed-point parts by a value of an exponent part as appropriate, and furthermore outputs a compressed exponent part or a difference compressed exponent part, which is a difference value of the exponent part, or a difference exponent part as data coded along with the fixed-point part.
The waveform data coding devices according to Japanese Unexamined Patent Application, Publication No. H07-160267 and Japanese Unexamined Patent Application, Publication No. H07-199996 store an exponent part of floating point data by finite difference and standardize exponent parts corresponding to a predetermined number of consecutive fixed-point parts by a value of one exponent part. The coding of these waveform data coding devices incur less processing load on hardware as well as less deterioration in sound quality.
Incidentally, there has been a need for electronic musical instruments with high-quality sound recently. Therefore, in terms of coding with a constant bit rate in which the bit rate is always constant, when a waveform of sound changes abruptly at an attack part of a piano sound, for example, the bit rate may not be sufficient in order to maintain a certain level of sound quality. This phenomenon may occur in the waveform data coding device according to Japanese Unexamined Patent Application, Publication No. H07-160267 and Japanese Unexamined Patent Application, Publication No. H07-199996. Therefore, there has been a need for realizing coding and decoding that can decrease processing load on hardware as well as can maintain high-quality sound even when a waveform of sound changes abruptly.